<?php
/**
 * 全站滚动消息
 * User: guojing
 * Date: 2020/5/3
 * Time: 18:25
 */

namespace app\common\model;

use think\Model;

class TipMsg extends Model
{

    protected $name = 'tip_msg';

    public static function dataList($params = [])
    {
        $where = [
            'c_month' => date('Ym'),
            'msg_status' => 1
        ];
        $page = '1, 100';
        $list = self::where($where)->order('id desc')->page($page)->select();
        return $list ? $list : [];
    }

    public static function addRecord($data)
    {
        $data['c_month'] = date('Ym');
        $data['c_day'] = date('Ymd');
        $data['createtime'] = time();
        $data['updatetime'] = time();
        return self::create($data);
    }

}